﻿<%@ import Namespace= "System.Drawing" %> 
<%@ import Namespace= "System.Drawing.Imaging" %> 

<%@ Control Language="C#"%>
<%@ Import Namespace="ComputerShopE3.Models" %>
<%@ Import Namespace="MyHelper" %>
<% SAN_PHAM item = (SAN_PHAM)ViewData["SanPham"]; %>
    <% if (item == null)
       { %>
            <%--<th>
                id
            </th>--%>
            <th>
                Hình ảnh
            </th>
            <th>
                Tên sản phẩm
            </th>
            <%--<th>
                NhaSanXuat
            </th>--%>
           <%-- <th>
                NhaPhanPhoi
            </th>--%>
            <th>
                Mô tả
            </th>
            <th>
                Giá
            </th>
            <%--<th>
                KhuyenMai
            </th>--%>
            <th>
                Điểm
            </th>
            <%--<th>
                SoLuongTon
            </th>--%>
            <%--<th>
                NgayThemSP
            </th>--%>
            <%--<th>
                BaoHanh
            </th>--%>
            <%--<th>
                LoaiSanPham
            </th>--%>
            <%--<th>
                LaLinhKien
            </th>--%>
            <%--<th>
                MauSac
            </th>--%>
    <% }
       else
       { %>
            
            <td>
             <% Size s = new Size(70,70);  %>
            <% foreach (var ha in item.HINH_ANH)
                   {
                    %>
                    <%= Html.ImageActionLink("../../content/data_images/" + ha.Url, "details", item.LOAI_SAN_PHAM.TenLoaiSanPham, new { id = item.id }, s, null)%>
                    <%} %>
                    
                    </td>
                    <%--<td>
                        <%= Html.Encode(item.id) %>
                    </td>--%>
                    <td>
                        <%= Html.ActionLink(item.TenSanPham, "Details", item.LOAI_SAN_PHAM.TenLoaiSanPham, new { id = item.id }, null)%>
                    </td>
                   <%-- <td>
                        <% if (item.NHA_SAN_XUAT != null)
                           { %>
                        <%= Html.Encode(item.NHA_SAN_XUAT.TenNSX)%>
                        <%} %>
                    </td>--%>
                    <%--<td>
                        <% if (item.NHA_PHAN_PHOI != null)
                           { %>
                        <%= Html.Encode(item.NHA_PHAN_PHOI.TenNhaPhanPhoi)%>
                        <% } %>
                    </td>--%>
                    <td>
                        <%= Html.Encode(item.MoTa)%>
                    </td>
                    <td>
                        <%
                            long fGia = item.Gia;
                            string strGia = string.Format("{0:c}", item.Gia);                         
           
                        %>
                        
                            
                        <%= Html.Encode(strGia)%>
                    </td>
                    <%--<td>
                        <%= Html.Encode(item.KHUYEN_MAI)%>
                    </td>--%>
                    <td>
                        <% var Diem = (item.Diem > 5) ? 5 : item.Diem; %>
                        <% for (int i = 0; i < Diem; i++)
                           { %>
                        <img src="../../Content/images/choice.png" />
                        <% }
                           Diem = 5 - Diem;
                           for (int i = 0; i < Diem; i++)
                           { %>
                        <img src="../../Content/images/nochoice.png"/>
                        <% } %>
                    </td>
                    <%--<td>
                        <%= Html.Encode(item.sp.SoLuongTon) %>
                    </td>
                    <td>
                        <%= Html.Encode(String.Format("{0:g}", item.sp.NgayThemSP)) %>
                    </td>--%>
                   <%-- <td>
                        <%= Html.Encode(item.BaoHanh) %>
                    </td>--%>
                    <%--<td>
                        <%= Html.Encode(item.LOAI_SAN_PHAM.TenLoaiSanPham) %>
                    </td>--%>
                   <%-- <td>
                        <%= Html.Encode(item.LaLinhKien) %>
                    </td>--%>
                    <%--<td>
                        <%= Html.Encode(item.MauSac) %>
                    </td>--%>
        
    <% } %>


